package com.xfz.Mapper;

import com.xfz.User.Supplier;
import com.xfz.User.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    @Select("select * from t_user where account = #{account}")
    User getUserByAccount(@Param("account") String account);

    @Insert("insert into t_user (name, account, password) values (#{user.name}, #{user.account}, #{user.password})")
    int saveUser(@Param("user") User user);

    @Update("update t_user set token=#{token} where id=#{id}")
    int tokenAdd(@Param("token") String token, @Param("id") Integer id);

    @Select("select * from t_user where token = #{token}")
    User getUserByToken(@Param("token") String token);



    @Update("update t_user set password =#{password} where account = #{account}")
    int updatePwd(@Param("password") String password,@Param("account") String account);


    @Select("select  * from t_user")
    List<User> userName();

    @Delete("delete from t_user where id=#{id}")
    int deluser(Integer id);
}
